import request from '../../utils/request'
import { IResponseBase } from '../user/type'
import type { IResponseCategory } from './type'
export const reqCategory1 = () =>
  request.get<any, IResponseCategory>('/admin/product/getCategory1')

export const reqCategory2 = (category1Id: string) =>
  request.get<any, IResponseCategory>(
    `/admin/product/getCategory2/${category1Id}`,
  )

export const reqCategory3 = (category2Id: string) =>
  request.get<any, IResponseCategory>(
    `/admin/product/getCategory3/${category2Id}`,
  )
export const reqAttrList = (
  category1Id: string,
  category2Id: string,
  category3Id: string,
) => {
  return request.get(
    `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,
  )
}

export const reqUpdateAttrList = (data: any) =>
  request.post<any, IResponseBase>('/admin/product/saveAttrInfo', data)
